<script setup>
// import { defineProps, defineEmits } from 'vue'
// 父传子
defineProps({
  name: {
    type: String,
    required: true
  },
  age: {
    type: Number,
    default: 3
  },
  isBig: {
    type: Boolean,
    required: true
  },
  cookie: {
    type: Array
  },
  address: {
    type: Object
  }
})

// 子传父
const emits = defineEmits(['event1'])

const setValue = () => {
  emits('event1', { city: '深圳' })
}
</script>

<template>
  <div>
    <p @click="setValue">子组件</p>
    <p>{{ name }}-{{ age }}-{{ isBig }}-{{ cookie }}-{{ address }}</p>
  </div>
</template>
